package com.vs.action;

import org.apache.log4j.Logger;

import com.vs.action.base.BaseActionSupport;
import com.vs.service.PersonService;
import com.vs.service.VehicleService;

@SuppressWarnings("serial")
public class TestAction extends BaseActionSupport{
	private static final Logger log = Logger.getLogger(TestAction.class);
	
	private PersonService personService;
	private VehicleService vehicleService;
	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}
	public void setVehicleService(VehicleService vehicleService) {
		this.vehicleService = vehicleService;
	}
	
	@Override
	public String execute() throws Exception {
		log.info("execute method ");
		personService.sayHello();
		return SUCCESS;
	}
	
	
	public String addVehicle(){
		log.info("执行添加设备Action");
		vehicleService.add();
		return SUCCESS;
	}
	
	
	public String removeVehicle(){
		log.info("执行删除设备Action");
		vehicleService.remove();
		return SUCCESS;
	}
	
	
	public String updateVehicle(){
		log.info("执行更新维护设备Action");
		vehicleService.update();
		return SUCCESS;
	}
	
	
	public String removeRelationVehicle(){
		log.info("执行更新维护设备Action");
		vehicleService.removeRelation();
		return SUCCESS;
	}
}
